public class RiskLevel {
    //初始化风险等级
    public static int getRiskLevel(int data){

        //判断是否为负数
        if(data == -1){
            throw new IllegalArgumentException();
        }

        //根据疫情数据规则，为疫情风险级别定级
        int level;
        if(data > 2000){
            level = 1;
        }else if(data >= 1300){
            level = 2;
        }else if(data >= 800){
            level = 3;
        }else if(data >= 500){
            level = 4;
        }else if(data >= 200){
            level = 5;
        }else if(data >= 50){
            level = 6;
        }else{
            level = 7;
        }

        return level;
    }
}
